#include<iostream>
#include<cmath>
using namespace std;
int main( )
{
    double a,b,x,y;
    int n;
    cin>>n;
    while(n--){
        cin>>x>>y;
        a=atan(x/y);
        cin>>x>>y;
        b=atan(x/y);
        printf("%.2lf\n",(abs(a-b))/3.1415926*180);
    }
}
